<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增岗位')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-post-add" th:object="${info}">
        <input id="id" name="id" type="hidden" th:field="*{id}">
        <div class="form-group">
            <label class="col-sm-3 control-label">商品编号：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="productCode" id="productCode" th:field="*{productCode}" required readonly aria-readonly="true">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">商品名称：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="productName" id="productName" th:field="*{productName}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">操作状态：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="type" id="type" th:field="*{type}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">商品数量：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="productCount" id="productCount" th:field="*{productCount}" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">创建时间：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="createTime" id="createTime" th:field="*{createTime}" required readonly aria-readonly="true">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">处理人：</label>
            <div class="col-sm-8">
                <input class="form-control" type="text" name="createUser" id="createUser" th:field="*{createUser}" required>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">修改说明：</label>
            <div class="col-sm-8">
                <textarea type="text" id="desc" name="desc" th:field="*{desc}" style="margin: 0px; width: 478px; height: 137px;"></textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script type="text/javascript">
    var prefix = ctx + "cms/warehouse/info";

    $("#form-post-add").validate({
        onkeyup: false,
        rules:{
            name:{
                remote: {
                    url: ctx + "cms/warehouse/info/checkPostNameUnique",
                    type: "post",
                    dataType: "json",
                    data: {
                        "name" : function() {
                            return $.common.trim($("#id").val());
                        }
                    },
                    dataFilter: function(data, type) {
                        data="0"
                        return $.validate.unique(data);
                    }
                }
            },
            postSort:{
                digits:true
            },
        },
        messages: {
            "name": {
                remote: "bug 请忽视"
            }
        },
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-post-add').serialize());
        }
    }


</script>
</body>
</html>
